/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.user;

import java.util.ArrayList;
import java.util.Iterator;
import model.Campaign;

/**
 *
 * @author CUNEYT
 */
public class Governor extends User {

    private ArrayList<Campaign> campaigns = null;
    private ArrayList<Staff> staff = null;

    public Governor(String name, String surname, String username, char[] password) {
        super(name, surname, username, password, User.GOVERNOR);
        campaigns = new ArrayList<Campaign>();
        staff = new ArrayList<Staff>();
    }

    public ArrayList<Campaign> getActiveCampaigns() {
        ArrayList<Campaign> result = new ArrayList<Campaign>();
        for (Iterator<Campaign> it = campaigns.iterator(); it.hasNext();) {
            Campaign campaign = it.next();
            if (campaign.getStatus().equals(Campaign.ACTIVE)) {
                result.add(campaign);
            }
        }
        return result;
    }

    public ArrayList<Campaign> getCurrentNegotiations() {
        ArrayList<Campaign> result = new ArrayList<Campaign>();
        for (Iterator<Campaign> it = campaigns.iterator(); it.hasNext();) {
            Campaign campaign = it.next();
            if (campaign.getStatus().equals(Campaign.NEGOTIATION)) {
                result.add(campaign);
            }
        }
        return result;
    }

    public ArrayList<Staff> getStaff() {
        return staff;
    }

    public void setStaff(ArrayList<Staff> staff) {
        this.staff = staff;
    }

    public ArrayList<Campaign> getCampaigns() {
        return campaigns;
    }

    public void setCampaigns(ArrayList<Campaign> campaigns) {
        this.campaigns = campaigns;
    }
}
